package com.dragon.modules.yuegou.query.marketing;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.marketing.AnnouncementEntity;
import com.dragon.modules.yuegou.enums.marketing.AnnouncementStatus;
import com.dragon.modules.yuegou.enums.marketing.AnnouncementType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 公告信息表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-04-09 09:51:23
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class AnnouncementQuery extends AnnouncementEntity implements Query<AnnouncementEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 标题查询条件 */
	@JsonUnwrapped(prefix = "title")
	private Condition<String> titleCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "img")
	private Condition<String> imgCondition;

    /** 简介查询条件 */
	@JsonUnwrapped(prefix = "remarks")
	private Condition<String> remarksCondition;

    /** [枚举]类型：0-活动-ACTIVITY、1-咨询-ADVISORY、2-政策-POLICY查询条件 */
	@JsonUnwrapped(prefix = "type")
	private Condition<AnnouncementType> typeCondition;

    /** 公告内容查询条件 */
	@JsonUnwrapped(prefix = "info")
	private Condition<String> infoCondition;

    /** 阅读量查询条件 */
	@JsonUnwrapped(prefix = "readVolume")
	private Condition<Integer> readVolumeCondition;

    /** 创建人ID查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 更新人ID查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 更新时间查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 逻辑删除，1表示已删除,0表示未删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 删除人ID查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

    /** 删除时间查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

    /** [枚举]状态：0-未发送-UNSEND、1-已发送-SEND查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<AnnouncementStatus> statusCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public AnnouncementQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public AnnouncementQuery(AnnouncementEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public AnnouncementQuery(AnnouncementQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.titleCondition != null) {
			this.titleCondition = other.titleCondition.copy();
		}
		if(other.imgCondition != null) {
			this.imgCondition = other.imgCondition.copy();
		}
		if(other.remarksCondition != null) {
			this.remarksCondition = other.remarksCondition.copy();
		}
		if(other.typeCondition != null) {
			this.typeCondition = other.typeCondition.copy();
		}
		if(other.infoCondition != null) {
			this.infoCondition = other.infoCondition.copy();
		}
		if(other.readVolumeCondition != null) {
			this.readVolumeCondition = other.readVolumeCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if(other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
		this.setOther(other);
	}
	private void setOther(AnnouncementQuery other){
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
		if(other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
	}

	@Override
	public QueryWrapper<AnnouncementEntity> toQueryWrapper() {
		QueryWrapper<AnnouncementEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (titleCondition != null) {
			titleCondition.toWrapper(wrapper, COL_TITLE);
		}
		if (imgCondition != null) {
			imgCondition.toWrapper(wrapper, COL_IMG);
		}
		if (remarksCondition != null) {
			remarksCondition.toWrapper(wrapper, COL_REMARKS);
		}
		if (typeCondition != null) {
			typeCondition.toWrapper(wrapper, COL_TYPE);
		}
		if (infoCondition != null) {
			infoCondition.toWrapper(wrapper, COL_INFO);
		}
		if (readVolumeCondition != null) {
			readVolumeCondition.toWrapper(wrapper, COL_READ_VOLUME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		return getQueryWrapper(wrapper);
	}

	private QueryWrapper<AnnouncementEntity> getQueryWrapper(QueryWrapper<AnnouncementEntity> wrapper){
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param busdIdCondition 商圈ID查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回标题查询条件
	 * 
	 * @return titleCondition 标题查询条件
	 */
	public Condition<String> title() {
		this.titleCondition = new Condition<>();
		return this.titleCondition;
	}
	
	/**
	 * 获取标题查询条件
	 * 
	 * @return titleCondition 标题查询条件
	 */
	public Condition<String> getTitleCondition() {
		return titleCondition;
	}

	/**
	 * 设置标题查询条件
	 * 
	 * @param titleCondition 标题查询条件
	 */
	public void setTitleCondition(Condition<String> titleCondition) {
		this.titleCondition = titleCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return imgCondition 查询条件
	 */
	public Condition<String> img() {
		this.imgCondition = new Condition<>();
		return this.imgCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return imgCondition 查询条件
	 */
	public Condition<String> getImgCondition() {
		return imgCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param imgCondition 查询条件
	 */
	public void setImgCondition(Condition<String> imgCondition) {
		this.imgCondition = imgCondition;
	}

	/**
	 * 构造并返回简介查询条件
	 * 
	 * @return remarksCondition 简介查询条件
	 */
	public Condition<String> remarks() {
		this.remarksCondition = new Condition<>();
		return this.remarksCondition;
	}
	
	/**
	 * 获取简介查询条件
	 * 
	 * @return remarksCondition 简介查询条件
	 */
	public Condition<String> getRemarksCondition() {
		return remarksCondition;
	}

	/**
	 * 设置简介查询条件
	 * 
	 * @param remarksCondition 简介查询条件
	 */
	public void setRemarksCondition(Condition<String> remarksCondition) {
		this.remarksCondition = remarksCondition;
	}

	/**
	 * 构造并返回[枚举]类型：0-活动-ACTIVITY、1-咨询-ADVISORY、2-政策-POLICY查询条件
	 * 
	 * @return typeCondition [枚举]类型：0-活动-ACTIVITY、1-咨询-ADVISORY、2-政策-POLICY查询条件
	 */
	public Condition<AnnouncementType> type() {
		this.typeCondition = new Condition<>();
		return this.typeCondition;
	}
	
	/**
	 * 获取[枚举]类型：0-活动-ACTIVITY、1-咨询-ADVISORY、2-政策-POLICY查询条件
	 * 
	 * @return typeCondition [枚举]类型：0-活动-ACTIVITY、1-咨询-ADVISORY、2-政策-POLICY查询条件
	 */
	public Condition<AnnouncementType> getTypeCondition() {
		return typeCondition;
	}

	/**
	 * 设置[枚举]类型：0-活动-ACTIVITY、1-咨询-ADVISORY、2-政策-POLICY查询条件
	 * 
	 * @param typeCondition [枚举]类型：0-活动-ACTIVITY、1-咨询-ADVISORY、2-政策-POLICY查询条件
	 */
	public void setTypeCondition(Condition<AnnouncementType> typeCondition) {
		this.typeCondition = typeCondition;
	}

	/**
	 * 构造并返回公告内容查询条件
	 * 
	 * @return infoCondition 公告内容查询条件
	 */
	public Condition<String> info() {
		this.infoCondition = new Condition<>();
		return this.infoCondition;
	}
	
	/**
	 * 获取公告内容查询条件
	 * 
	 * @return infoCondition 公告内容查询条件
	 */
	public Condition<String> getInfoCondition() {
		return infoCondition;
	}

	/**
	 * 设置公告内容查询条件
	 * 
	 * @param infoCondition 公告内容查询条件
	 */
	public void setInfoCondition(Condition<String> infoCondition) {
		this.infoCondition = infoCondition;
	}

	/**
	 * 构造并返回阅读量查询条件
	 * 
	 * @return readVolumeCondition 阅读量查询条件
	 */
	public Condition<Integer> readVolume() {
		this.readVolumeCondition = new Condition<>();
		return this.readVolumeCondition;
	}
	
	/**
	 * 获取阅读量查询条件
	 * 
	 * @return readVolumeCondition 阅读量查询条件
	 */
	public Condition<Integer> getReadVolumeCondition() {
		return readVolumeCondition;
	}

	/**
	 * 设置阅读量查询条件
	 * 
	 * @param readVolumeCondition 阅读量查询条件
	 */
	public void setReadVolumeCondition(Condition<Integer> readVolumeCondition) {
		this.readVolumeCondition = readVolumeCondition;
	}

	/**
	 * 构造并返回创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置创建人ID查询条件
	 * 
	 * @param createdByCondition 创建人ID查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置更新人ID查询条件
	 * 
	 * @param modifiedByCondition 更新人ID查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置更新时间查询条件
	 * 
	 * @param modifiedTimeCondition 更新时间查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @param delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回删除人ID查询条件
	 * 
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}
	
	/**
	 * 获取删除人ID查询条件
	 * 
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置删除人ID查询条件
	 * 
	 * @param delByCondition 删除人ID查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

	/**
	 * 构造并返回删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置删除时间查询条件
	 * 
	 * @param delTimeCondition 删除时间查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

	/**
	 * 构造并返回[枚举]状态：0-未发送-UNSEND、1-已发送-SEND查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-未发送-UNSEND、1-已发送-SEND查询条件
	 */
	public Condition<AnnouncementStatus> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}
	
	/**
	 * 获取[枚举]状态：0-未发送-UNSEND、1-已发送-SEND查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-未发送-UNSEND、1-已发送-SEND查询条件
	 */
	public Condition<AnnouncementStatus> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置[枚举]状态：0-未发送-UNSEND、1-已发送-SEND查询条件
	 * 
	 * @param statusCondition [枚举]状态：0-未发送-UNSEND、1-已发送-SEND查询条件
	 */
	public void setStatusCondition(Condition<AnnouncementStatus> statusCondition) {
		this.statusCondition = statusCondition;
	}

}
